% Script for calling main test procedure in paper

% Running the script below gives output corresponding to the right-most
% column of Panel A of Table 1 and Panel D of Figure 1.
clear;clc;

% Data included below are the FF5 factors and risk-free rate from 
% Kenneth French's website. 
% Inflation is the CPI
load FactorData_distribute

% choose excess return factors for desired test
M_factors = cat(2, MktRF, SMB,HML,RMW,CMA);
RF_sample = RF - Inflation; % to get real risk-free rate

% in the paper we test the pricing factors at different horizons, but other test assets could be used
test_assets = M_factors;

% horizons used in paper for joint tests
horizons = [1 3 6 12 24 48]';

[pval_MHR_test, MAPE, maxSR, maxIR, PricingErrors] = MHR_test_linfac_for_dist(RF_sample, test_assets, M_factors, horizons)

